package com.hzh.test01.wind;

public class Test {
    public static void main(String[] args) {
        String line = "2021-12-31 17:35:0.325,23460191,PCM,7894,tigxbuncztlx5u3@gmail.com,山东,188.81,\"{\\\"ismain\\\":1\",level:34,ts:77,ver:29}";
        String jsonPart = line.substring(line.indexOf("{"), line.lastIndexOf("}") + 1); // 提取JSON字符串
        jsonPart = jsonPart.replace("\\\"", "\""); // 解决转义字符问题

//        ObjectMapper objectMapper = new ObjectMapper();
//        Map<String, Object> jsonMap = objectMapper.readValue(jsonPart, HashMap.class); // 解析为Map
//        String formattedJson = objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(jsonMap); // 格式化为缩进的JSON字符串

    }
}
